mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-19 18:46:43 +00:00
changed .data constants to variables
parent
4eb4abcc1f
commit
7664174f14
@ -3,7 +3,7 @@
|
|||||||
HWID_HOLO EQU 0x9 ; setup constants
|
HWID_HOLO EQU 0x9 ; setup constants
|
||||||
HOLO_DISPLAY_HEX EQU 1
|
HOLO_DISPLAY_HEX EQU 1
|
||||||
.data
|
.data
|
||||||
DISPLAYED_HEX EQU 0X000A ; create a word in memory called DISPLAYED_HEX and set its value to 0x000A
|
DISPLAYED_HEX: DW 0X000A ; create a word in memory called DISPLAYED_HEX and set its value to 0x000A
|
||||||
.text
|
.text
|
||||||
MOV A, HOLO_DISPLAY_HEX ; MOV the constant HOLO_DISPLAY_HEX into register A
|
MOV A, HOLO_DISPLAY_HEX ; MOV the constant HOLO_DISPLAY_HEX into register A
|
||||||
MOV B, [DISPLAYED_HEX] ; MOV the value inside the memory spot DISPLAYED_HEX into register B
|
MOV B, [DISPLAYED_HEX] ; MOV the value inside the memory spot DISPLAYED_HEX into register B
|
||||||
@ -28,11 +28,11 @@ HOLO_DISPLAY_STRING EQU 2
|
|||||||
HWID_HOLO EQU 0x9 ; setup constants
|
HWID_HOLO EQU 0x9 ; setup constants
|
||||||
HOLO_DISPLAY_DEC EQU 3
|
HOLO_DISPLAY_DEC EQU 3
|
||||||
.data
|
.data
|
||||||
DISPLAYED_DECIMAL EQU 42 ; create a word in memory called DISPLAYED_DECIMAL and set its value
|
DISPLAYED_DECIMAL: DW 42 ; create a word in memory called DISPLAYED_DECIMAL and set its value
|
||||||
; to 42
|
; to 42
|
||||||
.text
|
.text
|
||||||
MOV A, HOLO_DISPLAY_DEC ; MOV the constant HOLO_DISPLAY_DEC into register A
|
MOV A, HOLO_DISPLAY_DEC ; MOV the constant HOLO_DISPLAY_DEC into register A
|
||||||
MOV B, DISPLAYED_DECIMAL ; MOV the value inside the memory spot DISPLAYED_HEX into register B
|
MOV B, [DISPLAYED_DECIMAL] ; MOV the value inside the memory spot DISPLAYED_HEX into register B
|
||||||
HWI HWID_HOLO ; more magic
|
HWI HWID_HOLO ; more magic
|
||||||
BRK ; halt execution until next tick
|
BRK ; halt execution until next tick
|
||||||
```
|
```
|
||||||
@ -42,7 +42,7 @@ HWID_HOLO EQU 0x9 ; setup constants
|
|||||||
HOLO_DISPLAY_DEC EQU 3
|
HOLO_DISPLAY_DEC EQU 3
|
||||||
HOLO_DISPLAY_COLOR EQU 4
|
HOLO_DISPLAY_COLOR EQU 4
|
||||||
.data
|
.data
|
||||||
DISPLAYED_DECIMAL EQU 42 ; create a word in memory called DISPLAYED_DECIMAL and set its value
|
DISPLAYED_DECIMAL: DW 42 ; create a word in memory called DISPLAYED_DECIMAL and set its value
|
||||||
; to 42
|
; to 42
|
||||||
.text
|
.text
|
||||||
MOV A, HOLO_DISPLAY_COLOR ; MOV the constant HOLO_DISPLAY_COLOR into register A
|
MOV A, HOLO_DISPLAY_COLOR ; MOV the constant HOLO_DISPLAY_COLOR into register A
|
||||||
@ -50,7 +50,7 @@ HOLO_DISPLAY_COLOR EQU 4
|
|||||||
MOV C, 0x0000 ; clear register C: no green and no blue
|
MOV C, 0x0000 ; clear register C: no green and no blue
|
||||||
HWI HWID_HOLO ; this interrupt will set the color to: #0000FF [C:B] also know as red
|
HWI HWID_HOLO ; this interrupt will set the color to: #0000FF [C:B] also know as red
|
||||||
MOV A, HOLO_DISPLAY_DEC ; MOV the constant HOLO_DISPLAY_DEC into register A
|
MOV A, HOLO_DISPLAY_DEC ; MOV the constant HOLO_DISPLAY_DEC into register A
|
||||||
MOV B, DISPLAYED_DECIMAL ; MOV the value that DISPLAYED_DECIMAL is pointing at into register B
|
MOV B, [DISPLAYED_DECIMAL] ; MOV the value that DISPLAYED_DECIMAL is pointing at into register B
|
||||||
HWI HWID_HOLO ; ...
|
HWI HWID_HOLO ; ...
|
||||||
BRK ; halt execution until next tick
|
BRK ; halt execution until next tick
|
||||||
```
|
```
|
Loading…
x
Reference in New Issue
Block a user