-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Assembler 4004 and update Assembler 8051 (#1537)
* Added Assembler 4004 * Update Assembler 8051
- Loading branch information
Showing
4 changed files
with
91 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
; H e l l o W o r l d | ||
; 48 65 6C 6C 6F 20 57 6F 72 6C 64 | ||
START | ||
LDM $4 ; High nibble of letter 'H' | ||
WRR ; Write to ROM output port | ||
LDM $8 ; Low nibble of letter 'H' | ||
WRR ; Write to ROM output port | ||
|
||
LDM $6 ; High nibble of letter 'e' | ||
WRR ; Write to ROM output port | ||
LDM $5 ; Low nibble of letter 'e' | ||
WRR ; Write to ROM output port | ||
|
||
LDM $6 ; High nibble of letter 'l' | ||
WRR ; Write to ROM output port | ||
LDM $C ; Low nibble of letter 'l' | ||
WRR ; Write to ROM output port | ||
|
||
LDM $6 ; High nibble of letter 'l' | ||
WRR ; Write to ROM output port | ||
LDM $C ; Low nibble of letter 'l' | ||
WRR ; Write to ROM output port | ||
|
||
LDM $6 ; High nibble of letter 'o' | ||
WRR ; Write to ROM output port | ||
LDM $F ; Low nibble of letter 'o' | ||
WRR ; Write to ROM output port | ||
|
||
LDM $2 ; High nibble of 'space' | ||
WRR ; Write to ROM output port | ||
LDM $0 ; Low nibble of 'space' | ||
WRR ; Write to ROM output port | ||
|
||
|
||
LDM $5 ; High nibble of letter 'W' | ||
WRR ; Write to ROM output port | ||
LDM $7 ; Low nibble of letter 'W' | ||
WRR ; Write to ROM output port | ||
|
||
LDM $6 ; High nibble of letter 'o' | ||
WRR ; Write to ROM output port | ||
LDM $F ; Low nibble of letter 'o' | ||
WRR ; Write to ROM output port | ||
|
||
LDM $7 ; High nibble of letter 'r' | ||
WRR ; Write to ROM output port | ||
LDM $2 ; Low nibble of letter 'r' | ||
WRR ; Write to ROM output port | ||
|
||
LDM $6 ; High nibble of letter 'l' | ||
WRR ; Write to ROM output port | ||
LDM $C ; Low nibble of letter 'l' | ||
WRR ; Write to ROM output port | ||
|
||
LDM $6 ; High nibble of letter 'd' | ||
WRR ; Write to ROM output port | ||
LDM $4 ; Low nibble of letter 'd' | ||
WRR ; Write to ROM output port | ||
END | ||
JUN END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
ORG 00H | ||
SJMP INIT | ||
|
||
INIT: | ||
; Timer1 as the UART1 buadrate generator | ||
MOV TMOD, #20H ; Timer1, 8-bit auto-reload mode | ||
MOV TH1, #0FDH ; 9600 baudrate at 11.0592MHz | ||
MOV SCON, #50H ; Serial mode 1, enable reception | ||
SETB TR1 ; Start Timer1 | ||
MOV DPTR, #20H ; Point DPTR to the start of the string | ||
|
||
SEND: | ||
CLR A | ||
MOVC A, @A+DPTR ; Get the next character | ||
INC DPTR | ||
JZ DONE ; End program if the character is null | ||
MOV SBUF, A ; Send the character | ||
JNB TI, $ ; Wait for transmission to complete | ||
CLR TI ; Clear TI flag | ||
SJMP SEND | ||
|
||
DONE: | ||
SJMP $ ; Endless loop | ||
|
||
ORG 20H | ||
DB 'Hello World', 0 | ||
|
||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters