Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.82 KB | None | 0 0
  1. .globl mecall
  2. .globl handler
  3.  
  4.  
  5. handler:
  6. addi sp sp, -16 #Create stack space #@ NEW, MIGHT NEED POP STACK CAUSE MECALL WILL RUN AFTER HANDLER,
  7. #@ and i think this ceate stack space twice
  8. #and we need to pop stack before creating space again
  9. sw ra, 12(sp) #Preserve caller's return address
  10. sw t0, 8(sp)
  11.  
  12. csrrw a3, 65, zero #Store epc into reg, then push onto stack?
  13. #sw a0, 4(sp)
  14.  
  15.  
  16.  
  17. csrrw s1, 66, zero #Load ucause into s1
  18.  
  19. la s10, ExceptionTbl #Load address exceptions
  20. addi s9, zero, 4
  21. mul s1, s1, s9 #Mult ucause # by by 4 to get offset
  22. add s10, s10, s1 #Increment subroutine by offset
  23. lw, s8, (s10) #Load word at address s10 (exceptiontbl + offset)
  24. jalr s8
  25.  
  26.  
  27.  
  28.  
  29. mecall: #a7 contains num to indicate which subroutine to use
  30.  
  31.  
  32. mv a7, a6
  33.  
  34.  
  35. #USE CALLSTACK INSTEAD
  36. addi sp sp, -16 #Create stack space
  37. sw ra, 12(sp) #Preserve caller's return address
  38. sw t0, 8(sp) #@ ADDED B/C PLANCK USES T0 IN MAIN
  39. #sw t1, 52(sp)
  40. #sw t2, 48(sp)
  41. #sw t3, 44(sp)
  42. #sw t4, 40(sp)
  43. #sw t5, 36(sp)
  44. #sw t6, 32(sp)
  45. #sw a0, 28(sp)
  46. #sw a1, 24(sp)
  47. #sw a2, 20(sp)
  48. #sw a3, 16(sp)
  49. #sw a4, 12(sp)
  50. #sw a5 8(sp)
  51. #sw a6, 4(sp)
  52. #sw a7, (sp)
  53.  
  54. #sw s0, 8(sp) #Preserve frame pointer (Dont think i need this
  55. #sw s1, 36(sp) #Preserve s1, (do i need this?)
  56. #addi s0, sp, 12 #Set frame pointer (do i need this?)
  57.  
  58.  
  59. #JUMP TO VECTOR TABLE
  60.  
  61.  
  62. #FOR UCAUSE 0 AND 1, DONT NEED TO INCREMENT EPC BY 4 BECAUSE JUMP AUTOMATICALLY DOES THIS?
  63.  
  64.  
  65.  
  66.  
  67. ENVCALL:
  68. #Identify subroutine. RUN THIS IF UCAUSE IS 8
  69. la s10 Subroutines #Load address of Subroutines into x18
  70. mv s11, a7 #load a7 into other reg so we don't mess it up
  71. addi s9, zero, 4
  72. mul s11, s11, s9 #multiply s11 by 4 to get offset
  73. add s10, s10, s11 #Increment Subroutine address by offset
  74. lw s8, (s10) #load word at address s10
  75. jalr s8
  76.  
  77.  
  78. #@ LOOK AT BIT 31 TO SEE IF CAUSED BY INT OR EXC.
  79.  
  80.  
  81. PrintStringHelper: #Same as PrintChar but returns to PrintString instead of returning to inttest
  82. li s6, 1 #holds immediate val 1
  83. lw s2, TCR #load value of word at label TCR (which is actual address of TCR) into s2
  84. lw s1, (s2) #loads value from TCR into s1
  85. bne s1, s6, PrintChar #loop if TCR not ready to display
  86. lw s5, TDR #Load address TDR into t0
  87. sw a0(s5) #Store a0 to TDR #THIS LINE IS BREAKINNG THINGS. A0
  88.  
  89. ret
  90.  
  91. PrintChar:
  92. li s6, 1 #holds immediate val 1
  93. lw s2, TCR #load value of word at label TCR (which is actual address of TCR) into s2
  94. lw s1, (s2) #loads value from TCR into s1
  95. bne s1, s6, PrintChar #loop if TCR not ready to display
  96. lw s5, TDR #Load address TDR
  97. sw a0(s5) #Store a0 to TDR
  98.  
  99. b teardown #Return to inttest
  100.  
  101.  
  102.  
  103. ReadInt:
  104. lw s0, RCR #Load RCR address
  105. lw s1, (s0) #Load value of RCR
  106. beqz s1, ReadInt #Branch if keyboard has not entered character
  107. lw s2, RDR #load address of RDR
  108. lb a0, (s2) #Load value RDR into a0
  109. addi a0, a0 -48 #convert to decimal from hex
  110.  
  111. ret
  112.  
  113. ReadChar:
  114. lw s0, RCR #Load RCR address
  115. lw s1, (s0) #Load RCR value
  116. beqz s1, ReadChar #branch if keyboard has not received char
  117. lw s2, RDR #load address of RDR
  118. lb a0, (s2) #Load value of RDR
  119.  
  120. b teardown
  121.  
  122. #Only s0-s11. These are preserved across calls and (And I don't use them in quiz.asm)
  123. #If I used registers that aren't preserved (a0-17, t0-t6), store the values of these registers into memory using sw (the values they contain from quiz.asm)
  124. #Then use them as needed in mecall file
  125. #Finally load the values back into register before returning to quiz.asm
  126.  
  127. ReadString:
  128.  
  129. lw s1, enter #load x31 with enter key
  130. li s8, 1 #Start counter at 1
  131. li s9, 20
  132.  
  133. ReceiverVerify: #x28 holds immediate 1
  134. #bgt s8, a1, EnterKeyPressed #branch if counter > max # of chars read #WHY??
  135. #beq s8, a1, NullChar #if max num? #DONT THINK I NEED THIS, JUST BRANCH WHEN ENTER KEY PRESSED
  136. lw s3, RCR #load address RCR
  137. lw s4, (s3) #load value RCR into s4 (RCR is 1 when keyboard receives new char)
  138. bnez s4, CharTyped #b if RCR is 1 (keyboard has received char)
  139.  
  140. #@ The Ready bit is automatically reset to 0 when the program reads the Receiver Data using an 'lw' instruction.
  141.  
  142.  
  143.  
  144. b ReceiverVerify #if keyboard has not received new char, loop
  145.  
  146.  
  147. CharTyped:
  148. lw s5, RDR #load address RDR
  149. lw s6, (s5) #load value RDR (last character typed), this resets RCR back o 0
  150.  
  151. beq s6, s1, EnterKeyPressed
  152.  
  153. sb s6, (a0) #Store letter into space for string #@ PRETTY SURE I SHOULD BE STORING IN A0, SHOULD ONLY STORE WHEN NEW CHAR TYPED
  154.  
  155. addi a0, a0, 1 #Increment string space pointer
  156.  
  157. addi s8, s8, 1 #Increment total counter
  158.  
  159. b ReceiverVerify
  160.  
  161. NullChar:
  162. li s6, 0
  163. sb s6(s7) #Store NullChar
  164.  
  165. EnterKeyPressed: #end str
  166. b teardown
  167.  
  168.  
  169.  
  170. Exit:
  171. la a0, ExitMessage #Use Trap 4 (PrintString) to print Exit Message
  172. li a6, 4
  173. jal mecall
  174. ret
  175.  
  176.  
  177. Undefined:
  178. la a0, Error #Use Trap 4 (PrintString) to print Error Message
  179. li a6, 4
  180. jal mecall
  181. li a7, 10 #Use exit routin
  182. ecall
  183.  
  184.  
  185. PrintString:
  186. #la a0, test_str #This is for testing. For asgn8, a str is already loaded into a0
  187. li a7, 4
  188. #jal mecall
  189.  
  190. mv t1, a0
  191.  
  192. printstrloop:
  193. lb a0, (t1) #AFTER THIS STEP DO I OUTPUT TO TDR?
  194.  
  195. beq zero, a0, teardown #Works successfuly, branches at end of string #@ !!! maybe i need to change this to add new line
  196. jal PrintStringHelper #previously, this jumped to PrintChar
  197. addi t1, t1, 1 #Get next char into t1 PROBLEM: After nullchar, execution resumes here
  198. b printstrloop
  199.  
  200. #addnewline:
  201. #li a0, 0x0A #Putnewchar in a0
  202. #lw s5, TDR #Load address TDR
  203. #sw a0(s5) #Store a0
  204.  
  205. #UCAUSE 0
  206. IAM:
  207. la a0, IAM_MSG
  208. li a6, 4 #PrintString
  209. #COPY RA INTO EPC
  210. lw ra, 12(sp)
  211. addi ra, ra, -4 #Decrement RA because teardown increments it
  212. csrrw zero, 65, ra #Load RA into EPC
  213. jal mecall
  214.  
  215.  
  216. IAF:
  217. la a0, IAF_MSG
  218. li a6, 4 #PrintString
  219. lw ra, 12(sp)
  220. addi ra, ra, -4 #Decrement RA because teardown increments it
  221. csrrw zero, 65, ra #Load RA into EPC
  222. jal mecall
  223.  
  224. #Note: Only IAM & IAF should load ra into EPC
  225. LAM:
  226. la a0, LAM_MSG1
  227. li a6, 4 #PrintString
  228. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!!
  229. jal mecall #after jal
  230. #after printing, resume execution here
  231. csrrw a0, 65, zero #store epc in a0
  232. jal hex_init
  233.  
  234. #After store_byte, resume execution here
  235. print_epc:
  236. #print 0x. first part of print_epc and print_x1 do this
  237. lw s1, (s2) #loads value from TCR into s1
  238. bne s1, s6, print_epc #loop if TCR not ready to display
  239. lw s5, TDR #Load address TDR
  240. li a0, 48 #decimal 0
  241. sw a0(s5) #Store a0 to TDR
  242.  
  243. #prints the x in "0x", need label to branch if TCR it ready
  244. print_x1:
  245. lw s1, (s2) #loads value from TCR into s1
  246. bne s1, s6, print_x1 #loop if TCR not ready to display
  247. li a0, 120 #decimal x
  248. sw a0(s5)#print the x
  249.  
  250. #PRINT REST OF EPC
  251. la a0, hex_buffer
  252. li a6, 4 #load printstr
  253. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!!
  254. jal mecall
  255. LAM2:
  256.  
  257. la a0, LAM_MSG2
  258. li a6, 4 #PrintString
  259. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!
  260. jal mecall
  261.  
  262. csrrw a0, 67, zero #store utval in a0
  263. jal hex_init
  264.  
  265. #should resume exec here
  266. print_utval:
  267. #li s6, 1 #holds immediate val 1
  268. #lw s2, TCR #load value of word at label TCR (which is actual address of TCR) into s2
  269. lw s1, (s2) #loads value from TCR into s1
  270. bne s1, s6, print_utval #loop if TCR not ready to display
  271. lw s5, TDR #Load address TDR
  272. li a0, 48 #decimal 0
  273. sw a0(s5) #Store a0 to TDR
  274.  
  275. print_x2:
  276. lw s1, (s2) #loads value from TCR into s1
  277. bne s1, s6, print_x2 #loop if TCR not ready to display
  278. li a0, 120 #decimal x
  279. sw a0(s5)#print the x
  280.  
  281. #PRIME REST OF UTVAL
  282. la a0, hex_buffer
  283. li a6, 4 #load printstr
  284. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!!
  285. jal mecall
  286. #Since a5 is not set, program will exit
  287. #ebreak
  288. b teardown2
  289.  
  290.  
  291. hex_init:
  292. addi sp, sp, -32
  293. sw ra, 28(sp)
  294. sw t0, 24(sp)
  295. sw t1, 20(sp)
  296. sw t2, 16(sp)
  297. sw t3, 12(sp)
  298. sw t4, 8(sp)
  299. sw t5, 4(sp)
  300. sw t6, (sp)
  301.  
  302. la t0, hex_buffer
  303. li t1, 0
  304. li t2, 28
  305. li t3, 32
  306.  
  307. printhex:
  308. andi t4, t4, 0 #clear t4
  309. sll t4, a0, t1 #store epc in t4
  310. srl, t4, t4, t2 #Shift right 28 bits
  311.  
  312. li t5, 9 #String converter
  313. ble t4, t5, inc_epc
  314. addi t4, t4, 87
  315. b store_byte
  316.  
  317. inc_epc:
  318. addi t4, t4, 48
  319.  
  320. store_byte:
  321. sb t4, (t0) #store into buffer
  322. addi t0, t0, 1 #Point to next byte
  323. addi t1, t1, 4
  324. bne t1, t3, printhex #print another char if we havent reached 32nd bit
  325.  
  326. #Restore Stack once printing finished
  327. lw ra, 28(sp)
  328. lw ra, 28(sp)
  329. lw t0, 24(sp)
  330. lw t1, 20(sp)
  331. lw t2, 16(sp)
  332. lw t3, 12(sp)
  333. lw t4, 8(sp)
  334. lw t5, 4(sp)
  335. lw t6, (sp)
  336. addi sp, sp, 32 #pop stack space
  337.  
  338. ret #ret to print_epc/print_utval
  339. LAF:
  340. la a0, LAF_MSG1
  341. li a6, 4 #PrintString
  342. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!!
  343. jal mecall #after jal
  344. #after printing, resume execution here
  345. csrrw a0, 65, zero #store epc in a0
  346. jal hex_init
  347.  
  348. LAF_print_epc:
  349. #print 0x. first part of print_epc and print_x1 do this
  350. lw s1, (s2) #loads value from TCR into s1
  351. bne s1, s6, LAF_print_epc #loop if TCR not ready to display
  352. lw s5, TDR #Load address TDR
  353. li a0, 48 #decimal 0
  354. sw a0(s5) #Store a0 to TDR
  355.  
  356. #prints the x in "0x", need label to branch if TCR it ready
  357. LAF_print_x1:
  358. lw s1, (s2) #loads value from TCR into s1
  359. bne s1, s6, LAF_print_x1 #loop if TCR not ready to display
  360. li a0, 120 #decimal x
  361. sw a0(s5)#print the x
  362. #PRINT REST OF EPC
  363. la a0, hex_buffer
  364. li a6, 4 #load printstr
  365. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!!
  366. jal mecall #THIS LINE CAUSES ERROR WHEN RETURNING
  367.  
  368. LAF2:
  369. la a0, LAF_MSG2
  370. li a6, 4 #PrintString
  371. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!
  372. jal mecall
  373.  
  374. csrrw a0, 67, zero #store utval in a0
  375. jal hex_init
  376.  
  377. LAF_print_utval:
  378. lw s1, (s2) #loads value from TCR into s1
  379. bne s1, s6, LAF_print_utval #loop if TCR not ready to display
  380. lw s5, TDR #Load address TDR
  381. li a0, 48 #decimal 0
  382. sw a0(s5) #Store a0 to TDR
  383.  
  384. LAF_print_x2:
  385. lw s1, (s2) #loads value from TCR into s1
  386. bne s1, s6, LAF_print_x2 #loop if TCR not ready to display
  387. li a0, 120 #decimal x
  388. sw a0(s5)#print the x
  389.  
  390. #PRIME REST OF UTVAL
  391. la a0, hex_buffer
  392. li a6, 4 #load printstr
  393. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!!
  394. jal mecall
  395. #Since a5 is not set, program will exit
  396. b teardown2
  397.  
  398. SAM:
  399. la a0, SAM_MSG1
  400. li a6, 4 #PrintString
  401. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!!
  402. jal mecall #after jal
  403. #after printing, resume execution here
  404. csrrw a0, 65, zero #store epc in a0
  405. jal hex_init
  406.  
  407. SAM_print_epc:
  408. #print 0x. first part of print_epc and print_x1 do this
  409. lw s1, (s2) #loads value from TCR into s1
  410. bne s1, s6, SAM_print_epc #loop if TCR not ready to display
  411. lw s5, TDR #Load address TDR
  412. li a0, 48 #decimal 0
  413. sw a0(s5) #Store a0 to TDR
  414.  
  415. #prints the x in "0x", need label to branch if TCR it ready
  416. SAM_print_x1:
  417. lw s1, (s2) #loads value from TCR into s1
  418. bne s1, s6, SAM_print_x1 #loop if TCR not ready to display
  419. li a0, 120 #decimal x
  420. sw a0(s5)#print the x
  421.  
  422. #PRINT REST OF EPC
  423. la a0, hex_buffer
  424. li a6, 4 #load printstr
  425. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!!
  426. jal mecall #THIS LINE CAUSES ERROR WHEN RETURNING
  427.  
  428. SAM2:
  429. la a0, SAM_MSG2
  430. li a6, 4 #PrintString
  431. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!
  432. jal mecall
  433.  
  434. csrrw a0, 67, zero #store utval in a0
  435. jal hex_init
  436.  
  437. SAM_print_utval:
  438. lw s1, (s2) #loads value from TCR into s1
  439. bne s1, s6, SAM_print_utval #loop if TCR not ready to display
  440. lw s5, TDR #Load address TDR
  441. li a0, 48 #decimal 0
  442. sw a0(s5) #Store a0 to TDR
  443.  
  444. SAM_print_x2:
  445. lw s1, (s2) #loads value from TCR into s1
  446. bne s1, s6, SAM_print_x2 #loop if TCR not ready to display
  447. li a0, 120 #decimal x
  448. sw a0(s5)#print the x
  449.  
  450. #PRIME REST OF UTVAL
  451. la a0, hex_buffer
  452. li a6, 4 #load printstr
  453. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!!
  454. jal mecall
  455. #Since a5 is not set, program will exit
  456. b teardown2
  457.  
  458. SAF:
  459. la a0, SAF_MSG1
  460. li a6, 4 #PrintString
  461. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!!
  462. jal mecall #after jal
  463. #after printing, resume execution here
  464. csrrw a0, 65, zero #store epc in a0
  465. jal hex_init
  466.  
  467. SAF_print_epc:
  468. #print 0x. first part of print_epc and print_x1 do this
  469. lw s1, (s2) #loads value from TCR into s1
  470. bne s1, s6, SAF_print_epc #loop if TCR not ready to display
  471. lw s5, TDR #Load address TDR
  472. li a0, 48 #decimal 0
  473. sw a0(s5) #Store a0 to TDR
  474.  
  475. #prints the x in "0x", need label to branch if TCR it ready
  476. SAF_print_x1:
  477. lw s1, (s2) #loads value from TCR into s1
  478. bne s1, s6, SAF_print_x1 #loop if TCR not ready to display
  479. li a0, 120 #decimal x
  480. sw a0(s5)#print the x
  481.  
  482. #PRINT REST OF EPC
  483. la a0, hex_buffer
  484. li a6, 4 #load printstr
  485. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!!
  486. jal mecall #THIS LINE CAUSES ERROR WHEN RETURNING
  487.  
  488. SAF2:
  489. la a0, SAF_MSG2
  490. li a6, 4 #PrintString
  491. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!
  492. jal mecall
  493.  
  494. csrrw a0, 67, zero #store utval in a0
  495. jal hex_init
  496.  
  497. SAF_print_utval:
  498. lw s1, (s2) #loads value from TCR into s1
  499. bne s1, s6, SAF_print_utval #loop if TCR not ready to display
  500. lw s5, TDR #Load address TDR
  501. li a0, 48 #decimal 0
  502. sw a0(s5) #Store a0 to TDR
  503.  
  504. SAF_print_x2:
  505. lw s1, (s2) #loads value from TCR into s1
  506. bne s1, s6, SAF_print_x2 #loop if TCR not ready to display
  507. li a0, 120 #decimal x
  508. sw a0(s5)#print the x
  509.  
  510. #PRIME REST OF UTVAL
  511. la a0, hex_buffer
  512. li a6, 4 #load printstr
  513. addi a5, zero, 1 #***STORE 1 IN A5*** IMPORTANT FOR TEARDOWN!!!
  514. jal mecall
  515. #Since a5 is not set, program will exit
  516. b teardown2
  517.  
  518. BAD:
  519.  
  520. None:
  521.  
  522.  
  523.  
  524. teardown2:
  525. csrrw zero, 65, a3
  526.  
  527. teardown:
  528. lw ra, 12(sp) #Retrieve RA
  529. lw t0, 8(sp) #Retrieve t0
  530. #lw a3, 4(sp) #retrieve epc? #@ THIS DOESNT WORK. IS MY STACK WRONG?
  531. addi sp, sp, 16 #Pop current stack frame #? Program still works even if i comment this line out??
  532. #handler: # Just ignore it by moving epc (65) to the next instruction
  533. #Add 4 to epc, so uret returns to line AFTER ecall
  534. #lw t1, 52(sp)
  535. #lw t2, 48(sp)
  536. #lw t3, 44(sp)
  537. #lw t4, 40(sp)
  538. #lw t5, 36(sp)
  539. #lw t6, 32(sp)
  540. #lw a0, 28(sp)
  541. #lw a1, 24(sp)
  542. #lw a2, 20(sp)
  543. #lw a3, 16(sp)
  544. #lw a4, 12(sp)
  545. #lw a5, 8(sp)
  546. #lw a6, 4(sp)
  547. #lw a7, (sp)
  548.  
  549. csrrw t6, 65, zero
  550. addi t6, t6, 4
  551. csrrw zero, 65, t6
  552. addi a7, zero 0 #Clear a7 ecall won't jump to mecall if a7 contains something
  553. #ebreak
  554.  
  555. bgt a5, zero, triggered #If a5 is 1, store ra in epc (LAM)
  556. uret #Returns from handling an interrupt, used instead of jumping to uepc (the user-level exception program counter)
  557.  
  558. triggered:
  559. csrrw zero, 65, ra
  560. andi a5, a5, 0 #Clear a5
  561. uret
  562.  
  563. #8 is ID of ecall exception. ucause should be 8?
  564. #lw zero, 0
  565. # trigger trap for load access fault? #@ What does this mean? Dont need this. it causes exception
  566.  
  567. #To add external device interrupts. The “User External Interrupt Enable” (UEIP) bit must be set in the mie/uie register (CSR 4).
  568. #csrrsi zero, 4, 1
  569.  
  570.  
  571. #Set scratch reg to starting address of system stack?
  572.  
  573. #leave a7 as 0, load 4 into a6
  574.  
  575. .data #Use num in a7 as index to table
  576. test_str:
  577. .string "hi" #printstring called"
  578.  
  579. Subroutines:
  580. .word Undefined Undefined Undefined Undefined PrintString ReadInt Undefined Undefined ReadString Undefined Exit PrintChar ReadChar
  581.  
  582.  
  583. Error:
  584. .string "invalid or unimplemented syscall service"
  585.  
  586. ExitMessage:
  587. .string "\n-- program is finished running --"
  588.  
  589.  
  590. enter:
  591. .word 0x0A #Holds enter key
  592.  
  593. ReadStringBuffer:
  594. .space 20
  595.  
  596. TDR: #Transmitter Data Register - Characters written here will be displayed on screen
  597. .word 0xffff000c
  598.  
  599. TCR: #Transmitter Control Register - set to 1 when device ready to display character on screen
  600. .word 0xffff0008
  601.  
  602. RDR: #Receiver Data Register - Characters typed are stored here
  603. .word 0xffff0004
  604.  
  605. RCR: #Receiver Control Register - Bit [0] is one when keyboard has received a new character.
  606. .word 0xffff0000
  607.  
  608. ExceptionTbl:
  609. .word IAM IAF None None LAM LAF SAM SAF ENVCALL BAD #WHY BAD?
  610.  
  611. IAM_MSG:
  612. .string "Error in : Instruction load alignment error\n"
  613.  
  614. IAF_MSG:
  615. .string "**********\nError in : Instruction load access error\n"
  616.  
  617. None_MSG:
  618. .string "?"
  619.  
  620. LAM_MSG1:
  621. .string "**********\nRuntime exception at "
  622.  
  623. LAM_MSG2:
  624. .string ": Load address not aligned to word boundary "
  625.  
  626. LAF_MSG1:
  627. .string "\n**********\nRuntime exception at "
  628.  
  629. LAF_MSG2:
  630. .string ": Cannot read directly from text segment!"
  631.  
  632. SAM_MSG1:
  633. .string "\n**********\nRuntime exception at "
  634.  
  635. SAM_MSG2:
  636. .string ": Store address not aligned to word boundary "
  637.  
  638. SAF_MSG1:
  639. .string "\n**********\nRuntime exception at "
  640.  
  641. SAF_MSG2:
  642. .string ": Cannot write directly to text segment!"
  643.  
  644. hex_buffer:
  645. .space 32
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement