fix bootloader and add docs, minor fix to hello
This commit is contained in:
parent
de1ce5cdac
commit
48fbd4abed
@ -3,8 +3,9 @@
|
||||
//
|
||||
// Put your code here:
|
||||
|
||||
// Never
|
||||
// 78 101 118 101 114 32
|
||||
// send "Never Graduate!" on UART_TX
|
||||
// read BUT[1,2] and write to LED[1,2]
|
||||
|
||||
@78
|
||||
D=A
|
||||
@128
|
||||
@ -29,8 +30,6 @@ M=D //r
|
||||
D=A
|
||||
@133
|
||||
M=D // space
|
||||
// Graduate!
|
||||
// 71 114 97 100 117 97 116 101 33 32
|
||||
@71
|
||||
D=A
|
||||
@134
|
||||
@ -67,10 +66,14 @@ M=D //e
|
||||
D=A
|
||||
@142
|
||||
M=D //!
|
||||
@10
|
||||
@13
|
||||
D=A
|
||||
@143
|
||||
M=D // newline
|
||||
M=D // carriage return
|
||||
@10
|
||||
D=A
|
||||
@144
|
||||
M=D // line feed
|
||||
@128
|
||||
D=A
|
||||
@CHARBOOT
|
||||
@ -102,7 +105,7 @@ D=M
|
||||
M=D
|
||||
@CHARBOOT
|
||||
M=M+1
|
||||
@144
|
||||
@145
|
||||
D=A
|
||||
@CHARBOOT
|
||||
D=D-M
|
||||
@ -114,5 +117,3 @@ D;JEQ
|
||||
(ENDBOOT)
|
||||
@POLL
|
||||
0;JMP
|
||||
|
||||
|
||||
|
@ -4,6 +4,41 @@
|
||||
//
|
||||
// Put your code here:
|
||||
|
||||
|
||||
// @R0
|
||||
// D=M
|
||||
//
|
||||
// // Shift left by 8 bits by doubling 8 times
|
||||
// D=D+D // Shift left by 1 bit
|
||||
// D=D+D // Shift left by another bit
|
||||
// D=D+D // Shift left by another bit
|
||||
// D=D+D // Shift left by another bit (4-bit shift so far)
|
||||
// D=D+D // Shift left by another bit
|
||||
// D=D+D // Shift left by another bit
|
||||
// D=D+D // Shift left by another bit
|
||||
// D=D+D // Shift left by another bit (now D contains 0xEA00)
|
||||
//
|
||||
// D=M -> 1111110000010000
|
||||
// M=D -> 1110001100001000
|
||||
// M=0 -> 1110101010001000
|
||||
//
|
||||
// // Store the result in R1
|
||||
// @R1
|
||||
// M=D
|
||||
//
|
||||
//
|
||||
// 00010000 0 -> add 8 times and store to lhs
|
||||
// 00000001 1 -> add to lhs and store to word
|
||||
// 0001000000000001 write all the words to sram
|
||||
//
|
||||
// 0001000000000001
|
||||
// 1111110001010000
|
||||
// 0001000000000000
|
||||
// 1110001100001000
|
||||
// 0000000000000000
|
||||
// 1110101010000111
|
||||
|
||||
|
||||
// read data starting at address
|
||||
// 0x03 0x01 0x00 0x00
|
||||
@3
|
||||
@ -48,7 +83,7 @@
|
||||
@DECR2
|
||||
D;JGT
|
||||
|
||||
//command stack base address
|
||||
//command stack base address
|
||||
@100
|
||||
D=A
|
||||
@READCOMMAND
|
||||
@ -120,7 +155,7 @@
|
||||
(WESTWORD)
|
||||
@SPI
|
||||
D=M
|
||||
@R13
|
||||
@DEBUG0
|
||||
M=D
|
||||
DM=D+M
|
||||
DM=D+M
|
||||
@ -142,11 +177,11 @@
|
||||
M=D
|
||||
@SPI
|
||||
D=M
|
||||
@R14
|
||||
@DEBUG1
|
||||
M=D
|
||||
@R13
|
||||
@DEBUG0
|
||||
D=M
|
||||
@R14
|
||||
@DEBUG1
|
||||
D=D+M
|
||||
@SRAM_D
|
||||
M=D
|
||||
@ -154,7 +189,7 @@
|
||||
M=0
|
||||
@WORDCOUNT
|
||||
M=M+1
|
||||
@6
|
||||
@57343
|
||||
D=A
|
||||
@WORDCOUNT
|
||||
D=D-M
|
||||
|
Loading…
x
Reference in New Issue
Block a user