Question: Lexical analyzer(JAVA): Complete program to meet the following points *Validate that you have END as the last statement, after this nothing is processed and content
Lexical analyzer(JAVA):
Complete program to meet the following points
*Validate that you have END as the last statement, after this nothing is processed and content is deleted if it exists. *Delete blanks left and right. *Delete blank lines (Begin with ";"). *Delete comments (from ";" hereafter, start of line or comment of end of command).
Example:

Program:
package softwaresistemas;
import java.io.*;
public class FileASM {
public static void main (String args[]){
String linea;
try {
File archivoFuente = new File ("C:/Ensamblador/02TLIGHT.ASM");
FileReader fr = new FileReader (archivoFuente);
BufferedReader br = new BufferedReader(fr);
FileWriter archivoMaquina = new FileWriter("c:/Ensamblador/02TLIGHTNuevo.ASM");
PrintWriter pw = new PrintWriter(archivoMaquina);
while((linea=br.readLine())!=null){
linea = linea.trim();
if(linea.length()>0){
if(!linea.startsWith(";")){
System.out.println(linea);
pw.println(linea);
}
}
}
fr.close();
archivoMaquina.close();
}
catch(Exception e3){
e3.printStackTrace();
}finally{
}
}
}
A program to demonstrate NOV commands. ov is short for move CLO ; Close unwanted windaws MOVAL,15 MOBL,4 MOVCL,50 MOVDL,60 ; Copy 15 HEX into the AL register Final Copy 40 HEX into the BL register ; Copy 50 HEX into the CL register ; Copy 60 HEX into the DL register oO: CLO INC AL ;Increment AL for no particular reason AL,15 BL,40 CL,50 DL,60 INDIRECT MOVES MOV[Ae],AL; Copy value in AL to RAM location [40] MOV BL, [40]; Copy value in RAM location [A0] into BL 0O INC AL Mo [A0],AL Mo BL, [40] Mo [CL],AL o BL, [CL] JMP Foo MOV [CL],AL; Copy the value in AL to the RAM ; location that CL points to ; to into the BL register. ; PRESS ESCAPE TO STOP THE PROGRAM MOV BL, [CL]; Copy the RAM location that CL points JMP Foo END TASK END Look up the ASCII codes of the letters in H,E,L, L,O and move these ASCII codes to RAM addresses [ce], [C1], [C2], [C3] and [C41 Run the progren and watch haw the text appears on
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
