Skip to content

Commit

Permalink
Removing :__null__ in favour of dd 0
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Oct 20, 2024
1 parent ad04bb0 commit ba9003a
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 52 deletions.
102 changes: 50 additions & 52 deletions bootstrap4/bootstrap4.s
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

jump :main____

=__null__ 0000
=newline_ 000a
=hash____ 0023
=colon___ 003a
Expand Down Expand Up @@ -166,15 +165,15 @@
data \38\ff\ff\ff

:inclhand
data ____
dd 0

# Stack of input file handles, used for #include
:in_hands
:__null__
dd 0

# Global: Output file handle
:out_hand
data ____
dd 0


#===========================================================================
Expand Down Expand Up @@ -236,7 +235,7 @@
mov rz, rx

.ret_____
:__null__
dd 0
#===========================================================================


Expand Down Expand Up @@ -290,7 +289,7 @@
ret

.stash___
data ____
dd 0
#===========================================================================


Expand Down Expand Up @@ -999,7 +998,7 @@
db 0

:lastdef_
:__null__
dd 0

:inglobal
db 0
Expand Down Expand Up @@ -1132,8 +1131,7 @@

ldc rx, :zero____
eq r0, rx
ldc rx, :__null__
mov? r1, rx
sub? r1, r1

ldh rx, ffff
eq r1, rx
Expand Down Expand Up @@ -1347,7 +1345,7 @@

.jumptabl
# Return zero at EOF
:__null__
dd 0
.ret_____
:newline_
.eol_____
Expand Down Expand Up @@ -1520,11 +1518,11 @@

.cmtdstrd
data define\20
:__null__
dd 0

.cmtdstri
data include\20
:__null__
dd 0

#***************************

Expand Down Expand Up @@ -1903,7 +1901,7 @@
:space___

.buffer__
data ____
dd 0
#===========================================================================

# Useful function ends to return false or true in the flag
Expand Down Expand Up @@ -2217,7 +2215,7 @@
sys r1, r0, r2, r3
ret
.buffer__
data ____
dd 0
#===========================================================================


Expand All @@ -2237,7 +2235,7 @@
sys r1, r0, r2, r3
ret
.buffer__
data ____
dd 0
#===========================================================================


Expand All @@ -2256,7 +2254,7 @@
sys r1, r0, r2, r3
ret
.buffer__
data ____
dd 0
#===========================================================================


Expand All @@ -2283,7 +2281,7 @@

.errtoken
data Invalid\20token\20encountered
:__null__
dd 0
#===========================================================================


Expand Down Expand Up @@ -2770,7 +2768,7 @@

# Current global label
:mlglobal
:__null__
dd 0

#===========================================================================
# Args:
Expand All @@ -2787,7 +2785,7 @@

.error___
data Expected\20EOL
:__null__
dd 0
#===========================================================================


Expand Down Expand Up @@ -3783,151 +3781,151 @@
:instruct
# Standard ALU-type instructions
data mov\00
:__null__
dd 0
:i_stnd__
mov r?, r?

data add\00
:__null__
dd 0
:i_stnd__
add r?, r?

data sub\00
:__null__
dd 0
:i_stnd__
sub r?, r?

data mul\00
:__null__
dd 0
:i_stnd__
mul r?, r?

data div\00
:__null__
dd 0
:i_stnd__
div r?, r?

data mod\00
:__null__
dd 0
:i_stnd__
mod r?, r?

data or\00\00
:__null__
dd 0
:i_stnd__
or r?, r?

data and\00
:__null__
dd 0
:i_stnd__
and r?, r?

data xor\00
:__null__
dd 0
:i_stnd__
xor r?, r?

# Load/store
data ld\2eb
:__null__
dd 0
:i_stnd__
ldb [rL], r?

data ld\2ew
:__null__
dd 0
:i_stnd__
ldw [rL], r?

data ld\2ed
:__null__
dd 0
:i_stnd__
ldd [rL], r?

data st\2eb
:__null__
dd 0
:i_stnd__
stb [rS], r?

data st\2ew
:__null__
dd 0
:i_stnd__
stw [rS], r?

data st\2ed
:__null__
dd 0
:i_stnd__
std [rS], r?

# Compare
data eq\00\00
:__null__
dd 0
:i_stnd__
eq r?, r?

data ne\00\00
:__null__
dd 0
:i_stnd__
ne r?, r?

data gt\00\00
:__null__
dd 0
:i_stnd__
gt r?, r?

data lt\00\00
:__null__
dd 0
:i_stnd__
lt r?, r?

# Push/pop/PC
data push
:__null__
dd 0
:i_push__
data ????

data pop\00
:__null__
dd 0
:i_pop___
data ????

data call
:__null__
dd 0
:i_call__
data ????

data jump
:__null__
dd 0
:i_jump__
data ????

data ret\00
:__null__
dd 0
:i_ret___
data ????

data sys\00
:__null__
dd 0
:i_sys___
data ????

# Data
data db\00\00
:__null__
dd 0
:i_db____
data ????

data dw\00\00
:__null__
dd 0
:i_dw____
data ????

data dd\00\00
:__null__
dd 0
:i_dd____
data ????

data ds\00\00
:__null__
dd 0
:i_ds____
data ????

Expand All @@ -3953,22 +3951,22 @@
# Linked list of symbols:
# [global symbol pointer] [local symbol pointer] [write address] [prev symbol]
:symtab__
:__null__
dd 0

# Linked list of defines:
# [define string pointer] [token type] [token value] [prev define]
:deftab__
:__null__
dd 0

# Linked list of fixups:
# [fixup address] [global symbol pointer] [local symbol pointer] [prev fixup]
:fixuptab
:__null__
dd 0

# Deferred string table
# [fixup address] [string address in memory] [prev string]
:defsttab
:__null__
dd 0

# Current heap pointer
:heap____
Expand Down
1 change: 1 addition & 0 deletions checksums.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
fb40689210d3ffe5e671e2948bef72d8d33c91c307d2a74d21ca18abd4497888 out/b2.bin
15ce8defce737ae00d2b39ad62d6855b4c03d0dce841360f253c7c018d28f89c out/b3.bin
e2e94d523f6eafa8ff0e2c92b99e4a825d796c20c8835fe3395969a4143360f2 out/b4.bin
3f22ce082a38e996aacc3e3828a4d71c7eb1ab522d519e63f8e78bb85f195660 out/b5-0.bin

0 comments on commit ba9003a

Please sign in to comment.