nite owl
March 12th, 2007, 06:48 AM
Hi everyone, I apologise in advance for this off topic post, however I have searched for a couple of days now and have come up with no answers, and this community has always been good to me for answers.
I'm into my third week of my computer science course and for one of my subjects we have started coding in assembly language. However what we are using seems to be foreign to all the tutorials on the internet, even my lecturer dosent seem to have it fully grasped, why he would choose this is beyond me(if it helps we are using a compiler called SimpSim)???... here's a sample piece of the code:
load R2,0
jmp Print ;Print number in R2
org 60h
Print:
; Put the number in R2 in the output window
; Changed registers: R0, RA, RB, RC, RE, RF
load R0,39h ;ASCII-code of '9'
load RA,30h ;ASCII-code of '0'
load RB,7 ;'A'-'0'+10 (correction from numbers to letters)
; determine high nibble
load RC,0F0h ;filter high nibble
and RE,R2,RC ;high nibble of R2 in RE
ror RE,4 ;shift to low nibble
addi RE,RE,RA ;make it ASCII
jmpLE RE<=R0,isNum1 ;is an ASCII number
addi RE,RE,RB ;correct to ASCII letter
isNum1: store RE,[HiNibble] ;put high nibble on its place
; determine low nibble
load RC,0Fh ;filter low nibble
and RE,R2,RC ;low nibble of R2 in RE
addi RE,RE,RA ;make it ASCII
jmpLE RE<=R0,isNum2 ;is an ASCII number
addi RE,RE,RB ;correct to ASCII letter
.........I mostly am seeking help in understanding what these different registers mean i.e RC, RB etc. I only found out in passing that the RF register means just to display to standard output('cout <<' in c++ terms). Anyway Im completley lost, including my fellow students in my classes. Any help at all would be greatly appreciated!!! thankyou
B.T.W this piece of code is incomplete and writing after the ';' symbols are comments
I'm into my third week of my computer science course and for one of my subjects we have started coding in assembly language. However what we are using seems to be foreign to all the tutorials on the internet, even my lecturer dosent seem to have it fully grasped, why he would choose this is beyond me(if it helps we are using a compiler called SimpSim)???... here's a sample piece of the code:
load R2,0
jmp Print ;Print number in R2
org 60h
Print:
; Put the number in R2 in the output window
; Changed registers: R0, RA, RB, RC, RE, RF
load R0,39h ;ASCII-code of '9'
load RA,30h ;ASCII-code of '0'
load RB,7 ;'A'-'0'+10 (correction from numbers to letters)
; determine high nibble
load RC,0F0h ;filter high nibble
and RE,R2,RC ;high nibble of R2 in RE
ror RE,4 ;shift to low nibble
addi RE,RE,RA ;make it ASCII
jmpLE RE<=R0,isNum1 ;is an ASCII number
addi RE,RE,RB ;correct to ASCII letter
isNum1: store RE,[HiNibble] ;put high nibble on its place
; determine low nibble
load RC,0Fh ;filter low nibble
and RE,R2,RC ;low nibble of R2 in RE
addi RE,RE,RA ;make it ASCII
jmpLE RE<=R0,isNum2 ;is an ASCII number
addi RE,RE,RB ;correct to ASCII letter
.........I mostly am seeking help in understanding what these different registers mean i.e RC, RB etc. I only found out in passing that the RF register means just to display to standard output('cout <<' in c++ terms). Anyway Im completley lost, including my fellow students in my classes. Any help at all would be greatly appreciated!!! thankyou
B.T.W this piece of code is incomplete and writing after the ';' symbols are comments