Optimizing Code for Domain-Specific Connections and Data Structures

Click For Summary

Discussion Overview

The discussion revolves around the exploration of pure assembly language programming, specifically targeting the 80x86 architecture. Participants express interest in learning assembly language without relying on predefined functions, with aspirations to develop an operating system and interact directly with hardware components. The conversation includes inquiries about suitable assemblers, hardware specifications, and the feasibility of building a custom computer system from scratch.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant expresses a desire to learn assembly language thoroughly, aiming to write code without using predefined functions and to interact directly with hardware components like CRT monitors.
  • Another participant points out the challenges of communicating with hardware, noting that many video card manufacturers do not provide direct interface specifications and that BIOS calls are often necessary for certain operations.
  • There is a suggestion that while learning assembly language, focusing on writing MSDOS programs using standard BIOS and MSDOS function calls might be more practical than attempting to program hardware directly.
  • A later reply proposes the idea of assembling a custom computer from individual components and developing system software to manage hardware settings, questioning whether this is feasible.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to learning assembly language or the feasibility of directly programming hardware. There are multiple competing views regarding the practicality of using BIOS calls versus direct hardware access.

Contextual Notes

Participants acknowledge limitations regarding the availability of specifications for older hardware components and the challenges posed by modern systems lacking certain legacy ports. The discussion also highlights the potential complexity of developing an operating system and the need for a foundational understanding of assembly language.

Who May Find This Useful

This discussion may be of interest to individuals looking to deepen their understanding of assembly language programming, those interested in hardware-level programming, and hobbyists considering building custom computer systems.

  • #61
To add to rcgldr's comment, optimization depends more on the domain for practical purposes than anything else.

Optimizing code for getting the best use of "cycles" or "CPU time" is one thing, but a lot of what optimization is about is looking at your domain and seeing if there are some domain specific connections in the code that can be optimized or whether the domain exhibits the potential for data structures and appropriate algorithms that use these to do a task that is quicker than in another implementation that achieves the same thing.

Typically there is a kind of rule of thumb between the use of memory and computational complexity of a task (or algorithm) where the trade-off is that if you sacrifice memory, then the computational complexity increases but if you don't then it decreases.

The best example of this would be to compare a search algorithm with data that had no-overhead vs one that had a lot (i.e. a hash-table).

Some-where in between all of this you have say a binary-tree classification system for records, or even some kind of graph structure to help organize the data but a hash-table is one where if it's a good table with a good hash-algorithm with low collisions (you don't aim to remove collisions, you just aim to make them as uniform as possible) then using memory with the hash-table has a habit of making the speed a lot better and as a "rule of thumb" if you sacrifice less memory, you increase computational complexity.
 

Similar threads

  • · Replies 102 ·
4
Replies
102
Views
3K
Replies
16
Views
4K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 397 ·
14
Replies
397
Views
21K
Replies
6
Views
3K
  • · Replies 25 ·
Replies
25
Views
3K
Replies
86
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K