In the continuation of the assembly language series, this episode goes over some principles of floating-point arithmetic in TI assembly, and the numerous operations in the TI's built-in libraries.
In this video, we cover the following:
Floating-point numbers, in computing and assembly
The Radix-100 format
Floating-point assembly operations
The floating-point accumulator (FAC) and arguments (ARG)
XMLLNK library
GPLLNK library
Errors during calculations
Speed considerations
Program example - FLOAT
FLOAT (Assembly language)
Demonstration of assembly from the video. Displays two floating-point numbers, performs multiplication on them, and displays the result.
DEF RUN
REF VSBW,VMBW,GPLLNK,XMLLNK
*
OP1 BYTE 65,09,14,21,00,00,00,00
OP2 BYTE 64,03,80,77,00,00,00,00
RES BSS 8
FAC EQU >834A
ARG EQU >835C
FIL BYTE >83
EVEN
* DISPLAY FLOATING-POINT NUMBER
* R0 - VDP LOCATION
* R1 - ADDRESS OF NUMBER
DSPFLT
MOV R0,R3
LI R2,FAC
MOV *R1+,*R2+
MOV *R1+,*R2+
MOV *R1+,*R2+
MOV *R1,*R2
BLWP @GPLLNK
DATA >0014
MOVB @FAC+11,R1
SWPB R1
MOVB @FIL,R1
CLR R2
MOVB @FAC+12,R2
SWPB R2
BLWP @VMBW
RT
CALC
MOV *R0+,@FAC
MOV *R0+,@FAC+2
MOV *R0+,@FAC+4
MOV *R0,@FAC+6
MOV *R1+,@ARG
MOV *R1+,@ARG+2
MOV *R1+,@ARG+4
MOV *R1,@ARG+6
BLWP @XMLLNK
DATA >0800
MOV @FAC,*R2+
MOV @FAC+2,*R2+
MOV @FAC+4,*R2+
MOV @FAC+6,*R2+
RT
RUN
* PRINT OP1
LI R0,>004D
LI R1,OP1
BL @DSPFLT
* PRINT OP2
LI R0,>006D
LI R1,OP2
BL @DSPFLT
* CALCULATE FLOATING POINT MATH
LI R0,OP1
LI R1,OP2
LI R2,RES
BL @CALC
* PRINT RESULT
LI R0,>00AD
LI R1,RES
BL @DSPFLT
* PRINT SYMBOLS
LI R0,>006B
LI R1,'* '
BLWP @VSBW
LI R0,>00AB
LI R1,'= '
BLWP @VSBW
LOOP JMP LOOP
END
Posted in Assembly on 2020-10-28 17:44:00.
Hits: 1938