This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------------------------------- | |
// first.s: Output "Welcome to Assembly World." | |
// | |
// compile using: $ as first.s -o first.o | |
// link using: $ ld first.o -o first | |
// execute using: $ ./first | |
// | |
//---------------------------------------------------------------- | |
.section .data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------------------------------- | |
// Holan.s: print the 'Holan' in ascii code | |
// | |
// compile using: $ as Holan.s -o Holan.o | |
// link using: $ ld Holan.o -o Holan | |
// execute using: $ ./Holan | |
// | |
//---------------------------------------------------------------- | |
.text # this section is program | |
.global _start # entry point |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------------------------------- | |
// sum.s: | |
// | |
// compile using: $ as sum.s -o sum.o | |
// link using: $ ld sum.o -o sum | |
// execute using: $ ./sum | |
// | |
//---------------------------------------------------------------- | |
.text # this section is program | |
.global _start # entry point |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Expressive { | |
public static void main(String args[]) { | |
Expressive puzzler = new Expressive(); | |
puzzler.Oddity(); | |
puzzler.Chage(); | |
puzzler.LongDivision(); | |
puzzler.Elementary(); | |
puzzler.JoyOfHex(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text | |
.globl start | |
.code16 | |
start: | |
movb $0xE, %ah # write character in text mode for int 10h | |
movb $'H', %al # write 'H', 'o', 'l', 'a', 'n', ' ', 'w', 'o', 'r', 'l', 'd' | |
int $0x10 | |
movb $'o', %al | |
int $0x10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AS = as | |
LD = ld | |
OBJCOPY = objcopy | |
.s.o: | |
$(AS) -a $< -o $*.o > $*.map | |
all: disk.img | |
disk.img: holanBoot.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qemu-system-i386 -hda disk.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int power(int x); // 這叫函式原型,是用來騙編譯器的 | |
int main(void) { | |
int result = power(3); | |
printf("printf本身就是函數囉!\n"); | |
printf("3^2 = %d", result); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package holan.tw; | |
import java.awt.Graphics; | |
import java.awt.Graphics2D; | |
public class GameBoard extends javax.swing.JPanel { | |
public GameBoard() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package holan.tw; | |
import javax.swing.JFrame; | |
public class GameForm extends JFrame { | |
public GameForm() { | |
createUI(); | |
} |
OlderNewer