Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class main {
- public static void main(String[] args) {
- try {
- File w = new File("C:\\Tasm 1.4\\Tasm\\riven.asm");
- FileWriter out = new FileWriter(w);
- FileReader fr = new FileReader("C:\\Users\\Iman\\Desktop\\riven.txt");
- out.write(".model small \n");
- out.write(".code\n");
- out.write("org 100h\n");
- out.write("s: \n");
- int i = 0;
- int line = 0, col = 0;
- while ((i = fr.read()) != -1) {
- char a = (char) i;
- if (!Character.isSpace(a)) {
- System.out.print(a);
- out.write("mov ah,02\n");
- out.write("mov dh," + line + "\n");
- out.write("mov dl," + col + "\n");
- out.write("int 10h\n");
- out.write("mov ah,09\n");
- out.write("mov al,'" + a + "' \n");
- out.write("mov bh,00\n");
- out.write("mov bl,0Fh\n");
- out.write("mov cx,1\n");
- out.write("int 10h\n");
- out.write("\n");
- }
- col++;
- if (a == '\n') {
- col = 0;
- line++;
- }
- }
- out.write("int 20h\n");
- out.write("end s \n");
- fr.close();
- out.close();
- } catch (Exception e) {
- e.getMessage();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement