- Upvotes Received
- 19
- Posts with Upvotes
- 18
- Upvoting Members
- 10
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
134 Posted Topics
Re: The question seems a bit muddled. Almost all programs run directly on the processor, but the operating system does a lot of the heavy listing for them. Generally speaking the only program which: a.) Is not loaded by the operating system, and b.) Makes no use of operating system services, … | |
Re: TASM is an ancient program written for MS-DOS. I may be mistaken, but I do not think that Windows 7 any longer supports old MS-DOS programs. | |
Re: Some machine code instructions (the simpler ones) are implemented directly in hardware. Others will invoke a microcode program which is permanently stored within the processor. That microcode program will have access to all of the processor's internal registers - not just to the ones which the assembly language programmer has … | |
Re: No multitasking operating system will let you directly manipulate the hardware, without the OS being involved somewhere along the way. If you had one program trying to write something directly to the screen, and another program trying to write to that selfsame area of the screen, at the same time, … | |
Re: Assembly language cretainly does hide the internal operation of the processor. The cmp instruction is probably implemented as a microcode program which subtracts one number from the other, without storing the result, and then sets bits in the flags register depending upon whether the result is less than zeo, equal … | |
Re: If you are that much of a masochist, you would have to get hold of the technical reference manual(s) for your processor, and look up how assembly language instructions are encoded into machine code. Short of writing an operating system for a brand new model of computer, without any possibility … | |
![]() | Re: Why do you want to convert LBA to CHS? If you are thinking about the int 13h functions 2 and 3, try using their LBA equivalents, 42h and 43h instead. Most hard disks nowadays are programmed at the hardware level using LBA, and the conversion to CHS is done by … ![]() |
![]() | Re: "I would prefer a way where memory is not wasted and can be shrinked or expanded according to use. Is there any way to achieve it ?" C was originally developed for the purpose of writing an operating system, so it hasn't got much in the way of fancy stuff … |
Re: mov ax, 6745 ;any random number xor dx,dx ;convert 16 bit number in ax into 32 bit number in dx:ax mov bx.10 ;radix div bx ;5 into dx, 674 into ax add dl, '0' ;convert to digit mov mem[4], dl ;save units column digit xor dx,ax ;dx:ax = 674 div … | |
Re: If the file doesn't aleady exist, you need to open it with "w+" to reate a file for eading and writing. If it does already exist, you need to open it with "r+" for reading and writing. Not terribly logical, but there you are. Warning: If you try to open … | |
Re: mov al, 0x07 ; 0x07 = grey on black text colour stosb Why not load ah with 7 outside of the loop, and then do a stosw inside the loop? | |
Re: i = sizeof(long); i *= 8; max = (unsigned long)pow(2, size); printf("Maximum size of unsigned long is %lu\n", max); | |
Re: Nowadays you probably only need to be familiar with assembly language if you are writing an operating system, a compiler or, possibly, a linker (because instruction sets have their quirks). | |
Re: Interrupts occur whenever a piece of hardware needs attention, or the processor detects an error condition. There are also software interrupts which are mostly just a matter of convenience, and provide a means of indirect addressing. Operating systems will mostly not allow applications to issue software interrupts, because they could … | |
Re: If you are writing something like an operating system, and you have a system structure located at a fixed location, say 0x123456, then it would make sense to cast the integer 0x123456 as a pointer. Other than that, I can't think of any reason to do it. | |
Re: There is really no such thing as an assembly language interpreter. The problem with trying to interpret something like "mov ax,3" is that the interpreter would itself be modifying the ax, and other registers, as it ran. | |
Re: Because "" represents the single null byte which always terminates a string in C. | |
Re: If you are writing a text editor, you will need to store the characters being typed in into a buffer, and move characters right one place when you want to insert a new character. It would then be just a matter of redisplaying the buffers contents on the screen, with … | |
Re: None, ecept that char nam[] is usually followed by a string to intitialise it: `char name[] = "George Bush";` Whereas char *name; just declares a pointer, to be pointed at something later. | |
Re: [code] mov ah, 1 int 21h ;read ascii digit mov str[0], al ;save digit to string mov ah, 1 int 21h ;read ascii digit mov str[1], al ;save digit to string lea dx, str ;ds:dx -> string mov ah, 9 ;print the string int 21h mov ax, 4c00h ;finish int … | |
Re: I have never used INTO, and I have been programming the x86 processors for long enough. However, if you wanted to use it, you would have to write an interrupt handler for int 4, and then update the interrupt vector table so that the INTO exception was caught by the … | |
Re: If you are talking about the x86 architecture, there is no difference unless you are doing something very esoteric, like writing an operating system. | |
Re: If somebody was writing an operating system, they would probably want to get away from the messy bit flipping, associated with the hardware, as soon as possible, and instead have some nice abstractions to program. Also, by working with high level abstractions, if you wanted to port the operating system … | |
Re: You could try intercepting the WM_PAINT message. The DefWindowProc might not be doing anything. | |
Re: Line 40 would need to be replaced by: mov cl, 4 shr dx,cl In the first x86 processors, only shr dx,1 or shr dx,cl were allowed (for dx or any other register). | |
Re: MEM32 DD 316423 ;reserves 4 bytes of memory for the number 316423 MOV AX, 43981 ;loads the least significant bits of 43981 into ax ;and since 43981 < 65535, that means all of it SUB DX, DX ;make sure dx = 0, so that all 32 bits of dx:ax now … | |
Re: It is possible, but you would really have to know what you were doing, and it is unlikely to happen by accident. In assembly language the operating system is responsible for allocating memory, unless an operating system is what you are writing. | |
Re: The x86_64 family of processors has got 16 general purpose 64 bit registers, making a total of 128 bytes. So 1kb does sound like rather a lot - although I can't claim to be familiar with the architecture of other processor families. | |
Re: The number of cores available is largely in irrelevance to an applications programmer. When it comes time for an application to run, the operating system will decide which core it gets to run on. | |
Re: BIOS calls such as 0eh, int 10h, will print characters in graphics mode. | |
Re: 1.) Yes. 2.) The process which goes on within the processor to figure out what a machine code instruction means. 3.) A register is just a small area of memory within the orocessor itself. | |
Re: Scroll up/scroll down means that everything on the display (or in the window defined by cx/dx) moves up/down one or more lines. You probably want to put 7 in bh, which will give you the normal white text on a blck background. Almost always the page number is zero, unless … | |
Re: You sound as if you might be referring to a microcontroller, rather than the x86 family of processors this site is mainly concerned with. If that is so, you might be better of on a forum which is dedicated to that family of microcontrollers. Possibly, the manufacturer might host one. | |
Re: As the previous poster said, masm is a command line program. The executable file for recent versions is called ml.exe. Different assemblers have different syntaxes. Some are very similar to masm, others are not so similar. Jwasm is one of the most masm like, but it is not exactly the … | |
Re: You seem to be mixing code and data, and you can't do that in assembly language. First you would need to have all the code, and then define the variables at the end .............. .............. mov ah, 04c int 021 M1 dw ? m2 dw ? M3 dw ? M4 … | |
Re: *"Are DOS and Windows assembly different?"* Yes and no. DOS can only make use of the 16 bit instructions, whereas Windows also has access to 32 and (perhaps) 64 bit instructions. Also, operating systems perform various services on behalf of applications, such as writing stuff to disk. The interface between … | |
Re: Use any editor you like. I use Textpad, but Emacs is well known, and easier to use than it once was. Learnig C first wouldn't do any harm. Familiarity with C will make it easier to learn C++. Whether C or C++ would be better depends upon the type of … | |
Re: >" why is that at the end don't they all get converted in to machine language?" Because machine language is what the computer understands. All the rest is just there to make things more readable, and less error prone, for us mere humans. | |
Re: "The C Programming Language" by Kernighan and Ritchie. Many years ago that is how I got started; after trying a couple of other books which were as clear as mud. | |
Re: Have you included a prototype for ReadFromFile() in the header file for main.c? Something like: char ReadFromFile(void); | |
Re: No it wouldn't. Applications expect the operating system to do various things of their behalf, such as allocating memory, writing to disk, displaying stuff on the screen, getting keyboard input, and so on. Every operating system has its own way of making those services available to applications, and, apart from … | |
Re: The chief motivation for developing 64 bit processore was that, as their name suggests, their registers are 64 bits wide and they can theoretically access a maximum of 18,446,744,070Gb of memory, compared to "only" 4Gb of memory for a 32 bit processor. The 64 bit processors which are currently in … | |
Re: Assuming that they don't make use of some newer instructions, any assembly language program written for the architecture now joinly owned by Intel and AMD, can run on any of the processors you mention. The number of cores a processor has isn't really relevant, except insofar as it make the … | |
Re: I am surprised you can get it to work at all, Normally a mulitasking operating system won't let an application touch the hardware. After all, if every program tried to directly program the hardware, chaos would reign. What if Windows was using the 8253/4 to feed its scheduler, and somebody … | |
Re: [quote=natnit;327315]Thanks for the reply. The picture you paint of the current situation is quite grim. :) I was thinking more along the lines of a string conversion from the array. I'm assuming there are string to int hash functions, and a string is nothing more than an array of characters. … | |
Re: It seems that Vista's successor (already under development) has at least three code names, because I understood it to be "Vienna". It also is said by those who should know that, currently being written, is a successor to Windows, so the next version of Windows, after Vista, might conceivably be … | |
Re: [QUOTE=viperman224;22066]I'm not sure if this is the right spot to put this. I was wondering how would you create and operating system like linux or windows or novell. What programs would you use. I've always wondered how it was done. I would love to learn to create my own.[/QUOTE] You … | |
Re: To make DOS, and even some BIOS, calls from a TSR, you have to go to elaborate lengths to prevent the operating system from crashing. In particular, you need some DOS functions which Microsoft never officially documented until towards the end of MS-DOS's lifetime - although everybody knew they existed. … | |
Re: Reference parameter just means that you are returning the address of a variable, rather than the value of a variable. So to return the variable varname by reference you would just do something like: lea eax, varname ret Then you could access the variable by doing something like: mov edx, … |
The End.