answersLogoWhite

0

To create a simple assembly program that prints your name and city name in the middle of the screen with a white background and blue foreground, you can use x86 assembly with DOS interrupts. Below is a conceptual outline of the code:

section .data
    name db 'YourName', 0
    city db 'YourCity', 0

section .text
    global _start

_start:
    ; Set video mode to 80x25 text mode
    mov ah, 00h
    int 10h

    ; Calculate positions for middle rows
    mov ah, 0Eh          ; Teletype output
    ; Print name
    mov cx, 12          ; Starting column
    mov dx, 12          ; Starting row for name
    call print_string

    ; Print city
    mov cx, 12          ; Starting column
    mov dx, 13          ; Starting row for city
    call print_string

    ; Exit program
    mov ax, 4C00h
    int 21h

print_string:
    ; Set text attributes (blue foreground, white background)
    mov bh, 0          ; Page number
    mov bl, 1Eh        ; Blue on white
    ; Print the string
    mov si, name       ; Load address of string
.loop:
    lodsb              ; Load byte at DS:SI into AL
    cmp al, 0          ; Check for null terminator
    je .done
    mov ah, 0Eh        ; Teletype output function
    int 10h            ; BIOS interrupt
    jmp .loop
.done:
    ret

This code is a basic outline; you will need to adjust the string handling and positioning based on your requirements and assembly language environment.

User Avatar

AnswerBot

5d ago

What else can I help you with?

Related Questions

Which of the following commands would run program in the background?

program >bg


Which of the following does not describe a program?

computer


How does computer software work?

An algoritm is a computer program, that tells the computer, step by step, exactly what you want it to do. The computer then "executes" the program, following each step mechanically, to accomplish the end goal.


What is code optimization phase?

Optimization compiler is a compiler that can minimize or maximize attributes of an executable computer program. It is most common to minimize the time that is taken to execute a program.


Which Windows program is used to set file attributes?

It isn't exactly a Windows program, but the Microsoft utility that's used to edit file attributes is ATTRIB.EXE. It's run at the command line. For it's arguments type attrib /? at the command line or visit the related link below.


Which of the following is a flowcharting program?

Microsoft Visio


What program can provide assistance for debris removal following a Presidential declaration?

public assistance program


image enhancer?

An image enhancer is a program or tool that can improve the quality of an image by increasing its contrast, sharpness, and other attributes.


Which of the following is not something you can do with a word-processing program?

typing


Is it possible to make a program using for and not with while?

The following cases are all possible:- program without any for and while- program without for- program without while- program with both for and while


Which of the following best describes DCIP?

risk management program


Which of the following is NOT an example of a welfare, or income support, program?

Medicare