16-bit

16 bit Int vs 32 bit Int vs 64 bit Int

亡梦爱人 提交于 2019-12-03 02:26:10
问题 I've been wondering this for a long time since I've never had "formal" education on computer science (I'm in highschool), so please excuse my ignorance on the subject. On a platform that supports the three types of integers listed in the title, which one's better and why? (I know that every kind of int has a different length in memory, but I'm not sure what that means or how it affects performance or, from a developer's view point, which one has more advantages over the other). Thank you in

What are 16, 32 and 64-bit architectures?

点点圈 提交于 2019-12-02 16:41:26
What do 16-bit, 32-bit and 64-bit architectures mean in case of Microprocessors and/or Operating Systems? In case of Microprocessors, does it mean maximum size of General Purpose Register s or size of Integer or number of Address-line s or number of Data Bus line s or what? What do we mean by saying " DOS is a 16-bit OS ", " Windows in a 32-bit OS ", etc...? The difference comes down to the bit width of an instruction set passed to a general purpose register for operating on. 16 bits can operate on 2 bytes, 64 on 8 bytes of instruction at a time. You can often increase throughput of a

16 bit Int vs 32 bit Int vs 64 bit Int

痞子三分冷 提交于 2019-12-02 15:58:15
I've been wondering this for a long time since I've never had "formal" education on computer science (I'm in highschool), so please excuse my ignorance on the subject. On a platform that supports the three types of integers listed in the title, which one's better and why? (I know that every kind of int has a different length in memory, but I'm not sure what that means or how it affects performance or, from a developer's view point, which one has more advantages over the other). Thank you in advance for your help. "Better" is a subjective term, but some integers are more performant on certain

Shutting down computer with nasm

浪尽此生 提交于 2019-12-02 13:40:19
Is it possible to shut down or kill the power (is there a difference?) to a computer from nasm. I know you can use this to reboot: mov al, 0xFE out 0x64, al Is there an equivalent for shutting down? I am making my own 16 bit OS. The code you have is not guaranteed to work. It relies on two facts: the OS maps the physical IO memory into the process memory space. the machine has BIOS. Neither of the two might be true. The only reliable way to reboot or shutdown the machine programatically is to call the corresponding OS API. An alternative to calling the OS API (which you need, since you are

NASM Assembly 16bit “invalid combination of opcode and operands”

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 13:15:19
So I'm trying to write a program that creates a file and my name in it. But I get the "invalid combination of opcode and operands" on the mov handle, ax , and I don't know why. I saw here that you can do it so why can't I. Thank you in advance for any help. org 100h mov ah, 3ch ;create a file mov dx, name ;file name mov cx, 0 int 21h mov handle, ax ; save handle mov ah, 40h ;write to file mov bx, handle mov cx, 1000 mov dx, text ; what to write int 21h mov ah, 3eh ;close the file mov bx, handle int 21h mov ax, 4C00h ; end int 21h section .data name db "name.txt", 0 text db "Michal",0ah,0dh,"$"

Problem converting integer to ASCII code in x86 assembly

一笑奈何 提交于 2019-12-02 11:16:09
I am trying to use the code below to convert an integer in ax to ASCII codes. But running it outputs 515, rather than 513 as I expected. Where is the error? stk segment dw 32 dup(0) stk ends dts Segment posnum db 6 dup(0) ;0<x<65536; dts ends cds Segment Assume cs:cds , ds:dts,ss:stk Main Proc Far mov ax,seg dts mov ds,ax mov es,ax xor ax,ax mov ax,513 mov di,offset posnum Call ConvertPositive mov ah,09h mov dx ,offset posnum int 21h main_finish: mov ah,08h int 21h mov ax,4c00h int 21h Main endp cds Ends procs segment assume cs:procs ConvertPositive proc far xor dx,dx xor cx,cx mov bl,10 mov

Assembly (x86): <label> db 'string',0 does not get executed unless there's a jump instruction

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 05:10:48
问题 I've been banging my head against the wall in an attempt to understand why the following assembly is not correctly dumping the contents of 'HELLO_WORLD'. ; Explicitly set 16-bit [ BITS 16 ] [ ORG 0x7C00 ] ; Create label for hello world string terminated by null. HELLO_WORLD db 'hello world', 0 start: ; Move address of HELLO_WORLD into si mov SI, HELLO_WORLD call print_string ; Continue until the end of time jmp $ print_string: loop: ; Retrieve value stored in address at si mov al, [SI] mov ah

TASM 1.4 - Changing background color without clearing the screen?

↘锁芯ラ 提交于 2019-12-01 11:41:07
I'm using Tasm 1.4. I'm trying to change the color of the background and text without clearing the previous text, but it always ends up on clearing the previous text although the colors are changed. For example: mov ah,09h lea dx,text1 int 21h ;displays text1 mov ah,01h int 21h ;I input a character mov ah,06h mov bh,42h mov cx,0000h mov dx,184fh int 10h ;I use this to change the text and background color mov ah,02h mov bh,00h mov dh,0ch mov dl,20h int 10h ;along with this mov ah,09h lea dx,text2 int 21h ;displays text2 mov ah,02h mov dl,al int 21h ;displays the inputted character Now what

80x86 16-bit asm: lea cx, [cx*8+cx] causes error on NASM (compiling .com file)

跟風遠走 提交于 2019-12-01 05:15:55
The error NASM gives (despite my working OS) is "invalid effective address". Now I've seen many examples of how to use LEA and I think I got it right but yet my NASM dislikes it. I tried lea cx, [cx+9] and it worked; lea cx, [bx+cx] didn't. Now if I extended my registers to 32-bits (i.e. lea ecx, [ecx*8+ecx] ) everything would be well but i am restricted to use 16- and 8-bit registers only. Is here anyone so knowledgeable who could explain me WHY my assembler doesn't let me use lea the way I supposed it should be used? Michael This is because [bx+cx] isn't valid in any addressing mode on 16

80x86 16-bit asm: lea cx, [cx*8+cx] causes error on NASM (compiling .com file)

对着背影说爱祢 提交于 2019-12-01 01:58:59
问题 The error NASM gives (despite my working OS) is "invalid effective address". Now I've seen many examples of how to use LEA and I think I got it right but yet my NASM dislikes it. I tried lea cx, [cx+9] and it worked; lea cx, [bx+cx] didn't. Now if I extended my registers to 32-bits (i.e. lea ecx, [ecx*8+ecx] ) everything would be well but i am restricted to use 16- and 8-bit registers only. Is here anyone so knowledgeable who could explain me WHY my assembler doesn't let me use lea the way I