Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

HELP!!!!!!!!!!!

donaldmdonaldm Member Posts: 1
Hi - I am trying to complete a project for my Advanced Higher Computing project, that involves me using Assembly Code to compare 3 numbers, then redirect to where necessary. However, when the compiler tries to compile the program, it keeps throwing back an error "Undeclared Label: JL L1".

I am using the EMU8086 emulator. Here is my code below. Any help for a noob is appreciated. Thanks =D

[code]
#make_COM#

; COM file is loaded at CS:0100h
ORG 100h

PAGE 200,200
TITLE Compare 3 Numbers
.MODEL Small
.STACK 64

.DATA
FIRST DW 123 ;Declares first variable as 123
SECOND DW 213 ;Declares second variable as 213
THIRD DW 312 ;Declares third variable as 312
ANSWER DW ? ;Declares answer variable unknown

.CODE
MAIN:
MOV AX,@DATA
MOV DS,AX
MOV AX,FIRST
MOV BX,SECOND
MOV CX,THIRD
CMP AX,BX
JL L1
JMP L5
MOV ANSWER,BX
MOV AX,4C00H
INT 21H

L5:
CMP BX,CX
JL L2
MOV ANSWER,BX
MOV AX,4C00H
INT 21H
END L5

L1:
CMP AX,CX
JL l2
MOV ANSWER,AX
MOV AX,4C00H
INT 21H
END L1

L2:
CMP CX,BX
JL l3
MOV ANSWER,BX
MOV AX,4C00H
INT 21H
END L2

L3:
MOV ANSWER,CX
MOV AX,4C00H
INT 21H
END L3

END MAIN
[/code]
Sign In or Register to comment.