From 0f3bbdb1ada20ae70f5c611c41f449bf8f5e920d Mon Sep 17 00:00:00 2001 From: CloverGit Date: Tue, 2 Jan 2024 01:10:00 +0800 Subject: [PATCH] Added Assembler 4004 and update Assembler 8051 (#1537) * Added Assembler 4004 * Update Assembler 8051 --- #/8051 Assembly | 24 ------------------ a/Assembler 4004.asm | 60 ++++++++++++++++++++++++++++++++++++++++++++ a/Assembler 8051.asm | 28 +++++++++++++++++++++ readme.md | 5 ++-- 4 files changed, 91 insertions(+), 26 deletions(-) delete mode 100644 #/8051 Assembly create mode 100644 a/Assembler 4004.asm create mode 100644 a/Assembler 8051.asm diff --git a/#/8051 Assembly b/#/8051 Assembly deleted file mode 100644 index e6b30d74e..000000000 --- a/#/8051 Assembly +++ /dev/null @@ -1,24 +0,0 @@ -LCALL INIT_LCD -LCALL CLEAR_LCD -MOV A,#'H' -LCALL WRITE_TEXT -MOV A,#'E' -LCALL WRITE_TEXT -MOV A,#'L' -LCALL WRITE_TEXT -MOV A,#'L' -LCALL WRITE_TEXT -MOV A,#'O' -LCALL WRITE_TEXT -MOV A,#' ' -LCALL WRITE_TEXT -MOV A,#'W' -LCALL WRITE_TEXT -MOV A,#'O' -LCALL WRITE_TEXT -MOV A,#'R' -LCALL WRITE_TEXT -MOV A,#'L' -LCALL WRITE_TEXT -MOV A,#'D' -LCALL WRITE_TEXT diff --git a/a/Assembler 4004.asm b/a/Assembler 4004.asm new file mode 100644 index 000000000..409aa8a3b --- /dev/null +++ b/a/Assembler 4004.asm @@ -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 diff --git a/a/Assembler 8051.asm b/a/Assembler 8051.asm new file mode 100644 index 000000000..256c4d676 --- /dev/null +++ b/a/Assembler 8051.asm @@ -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 diff --git a/readme.md b/readme.md index 3b09229fe..b5bb61252 100644 --- a/readme.md +++ b/readme.md @@ -8,7 +8,7 @@ Thanks to everyone who continues to contribute; new languages are created every Make sure to see [contributing.md](/contributing.md) for instructions on contributing to the project! -## Languages (1000 total) +## Languages (1001 total) * [!](%23/%21) * [!@#$%^&*()_+](%23/%21%40%23%24%25%5E%26%E2%88%97%28%29_%2B) @@ -27,7 +27,6 @@ Make sure to see [contributing.md](/contributing.md) for instructions on contrib * [4test](%23/4test) * [4th Dimension](%23/4th%20Dimension.4dd) * [6969 Assembler](%23/6969%20Assembler) -* [8051 Assembly](%23/8051%20Assembly) * [8th](%23/8th) * [@tention!](%23/%40tention%21) * [@text](%23/%40text) @@ -111,11 +110,13 @@ Make sure to see [contributing.md](/contributing.md) for instructions on contrib * [Asm2bf](a/Asm2bf.asm) * [ASP](a/ASP.asp) * [Aspectj](a/Aspectj.aj) +* [Assembler 4004](a/Assembler%204004.asm) * [Assembler 6502](a/Assembler%206502.asm) * [Assembler 6502appleII](a/Assembler%206502appleII.asm) * [Assembler 6502c64](a/Assembler%206502c64.asm) * [Assembler 6809vectrex](a/Assembler%206809vectrex.asm) * [Assembler 8048 videopac](a/Assembler%208048%20videopac.asm) +* [Assembler 8051](a/Assembler%208051.asm) * [Assembler ARM aarch64](a/Assembler%20ARM%20aarch64.s) * [Assembler ARM](a/Assembler%20ARM.s) * [Assembler Atari 2600](a/Assembler%20Atari%202600.asm)