Skip to content

Instantly share code, notes, and snippets.

@febnug
Last active September 26, 2021 06:09
Show Gist options
  • Save febnug/f49b5090e228d09961cfed836685c338 to your computer and use it in GitHub Desktop.
Save febnug/f49b5090e228d09961cfed836685c338 to your computer and use it in GitHub Desktop.
; test code di : https://schweigi.github.io/assembler-simulator/index.html
;
; Febriyanto Nugroho
MOV A, 0x32
MOV B, 20
MOV C, 14
MOV D, 232
loop:
MOV [D], A
INC D
DEC C
CMP C, 0x0C
JE end
CMP C, 0x0B
JE end2
CMP C, 0x0A
JE end3
CMP C, 0x09
JE end4
CMP C, 0x08
JE end5
CMP C, 0x07
JE end6
MOV [D], 0x2A
INC D
JNZ loop
end:
MOV [D], 0x3D
INC D
MOV [D], 0x34
CMP C, 7
JE berhenti
DEC D
MOV [D], 0x2A
INC D
JMP loop
end2:
MOV [D], 0x3D
INC D
MOV [D], 0x38
DEC D
MOV [D], 0x2A
INC D
JMP loop
end3:
MOV [D], 0x3D
INC D
MOV [D], 0x31
INC D
MOV [D], 0x36
DEC D
DEC D
MOV [D], 0x2A
INC D
JMP loop
end4:
MOV [D], 0x3D
INC D
MOV [D], 0x33
INC D
MOV [D], 0x32
DEC D
DEC D
MOV [D], 0x2A
INC D
JMP loop
end5:
MOV [D], 0x3D
INC D
MOV [D], 0x36
INC D
MOV [D], 0x34
DEC D
DEC D
MOV [D], 0x2A
INC D
JMP loop
end6:
MOV [D], 0x3D
INC D
MOV [D], 0x31
INC D
MOV [D], 0x32
INC D
MOV [D], 0x38
DEC D
DEC D
INC D
INC D
loop2:
MOV [D], 0x0
DEC D
DEC B
CMP B, 6
JE end
JNE loop2
berhenti:
HLT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment