Refined the encoding some more.
This commit is contained in:
+15
-44
@@ -1,45 +1,16 @@
|
||||
.org 0x100
|
||||
.db msg "Hello, world!", 0
|
||||
.db more_stuff "AAAA", 0
|
||||
;.org 0x100
|
||||
;.db msg "Hello, world!", 0
|
||||
;.db more_stuff "AAAA", 0
|
||||
copy r7, 45
|
||||
cmp r8, 45
|
||||
|
||||
copy r1, more_stuff ;//B0 = 10110000
|
||||
copy more_stuff, 45
|
||||
loop:
|
||||
cmp r1, 0
|
||||
jz loop
|
||||
add r1, 1
|
||||
mov r1, 5 ; move the immediate value 5 into r1
|
||||
add r1,5 ; add 5 into r1
|
||||
int 21 ; maybe that will call some string drawing BIOS-like routine
|
||||
ret
|
||||
; form YYYY YYXX - Y opcode, X modifier
|
||||
; nop: 0000 0000
|
||||
; copy: 0000 01XX
|
||||
; add: 0000 10XX - | Perhaps running these will clear any overflow
|
||||
; addc: 0000 11XX - | or under flow flags if no errors occur.
|
||||
; sub: 0001 00XX - | jz should clear the zero flag.
|
||||
; subb: 0001 01XX - |
|
||||
; call: 0001 1100 - Always call [imm16]
|
||||
; jmp: 0010 0000 - Always jmp [imm16] (No short jumps)
|
||||
; jz: 0010 0100 - Always jz [imm16] (no short jumps)
|
||||
; cmp: 0010 11XX
|
||||
; push: 0011 11XX -| pop / push imm16/imm8 | reg
|
||||
; pop: 0100 00XX -|
|
||||
|
||||
;
|
||||
; imm8 imm16 reg
|
||||
; mov reg, imm16|reg
|
||||
; add reg, imm16|reg
|
||||
; int imm16
|
||||
; db [label] 'String data here' (Null byte is added implicatly by the assemblier)
|
||||
;
|
||||
; enum Type {
|
||||
; Op,
|
||||
; Reg,
|
||||
; Imm16,
|
||||
; Imm8
|
||||
; }
|
||||
; struct Token {
|
||||
; enum Type type;
|
||||
; char *value;
|
||||
; }
|
||||
;copy r1, 45 ;//B0 = 10110000
|
||||
;copy 2, 45
|
||||
;loop:
|
||||
; cmp r1, 0
|
||||
; jz loop
|
||||
; add r1, 1
|
||||
;mov r1, 5 ; move the immediate value 5 into r1
|
||||
;add r1,5 ; add 5 into r1
|
||||
;int 21 ; maybe that will call some string drawing BIOS-like routine
|
||||
;ret
|
||||
Reference in New Issue
Block a user