Click here to Skip to main content
14,329,837 members

C / C++ / MFC

 
GeneralRe: Want to learn C. Newbie. Where to start? Pin
Dar Brett18-Sep-18 4:54
memberDar Brett18-Sep-18 4:54 
GeneralRe: Want to learn C. Newbie. Where to start? Pin
CPallini18-Sep-18 10:28
mveCPallini18-Sep-18 10:28 
AnswerRe: Want to learn C. Newbie. Where to start? Pin
Joe Woodbury18-Sep-18 7:09
professionalJoe Woodbury18-Sep-18 7:09 
GeneralRe: Want to learn C. Newbie. Where to start? Pin
Quickbeam121318-Sep-18 7:17
memberQuickbeam121318-Sep-18 7:17 
AnswerRe: Want to learn C. Newbie. Where to start? Pin
Dar Brett18-Sep-18 20:17
memberDar Brett18-Sep-18 20:17 
QuestionCant call an assembly function in c++ code Pin
meerokh14-Sep-18 23:09
membermeerokh14-Sep-18 23:09 
QuestionRe: Cant call an assembly function in c++ code Pin
Richard MacCutchan15-Sep-18 21:16
protectorRichard MacCutchan15-Sep-18 21:16 
AnswerRe: Cant call an assembly function in c++ code Pin
meerokh15-Sep-18 23:29
membermeerokh15-Sep-18 23:29 
My project structure in eclipse is as follows
Coroutines
    Src
    Debug

Code for make_fcontext is in src folder in file "make_x86_64_sysv_elf_gas.S"
.text
.globl make_fcontext
.type make_fcontext,@function
.align 16
make_fcontext:
    /* first arg of make_fcontext() == top of context-stack */
    movq  %rdi, %rax

    /* shift address in RAX to lower 16 byte boundary */
    andq  $-16, %rax

    /* reserve space for context-data on context-stack */
    /* on context-function entry: (RSP -0x8) % 16 == 0 */
    leaq  -0x40(%rax), %rax

    /* third arg of make_fcontext() == address of context-function */
    /* stored in RBX */
    movq  %rdx, 0x28(%rax)

    /* save MMX control- and status-word */
    stmxcsr  (%rax)
    /* save x87 control-word */
    fnstcw   0x4(%rax)

    /* compute abs address of label trampoline */
    leaq  trampoline(%rip), %rcx
    /* save address of trampoline as return-address for context-function */
    /* will be entered after calling jump_fcontext() first time */
    movq  %rcx, 0x38(%rax)

    /* compute abs address of label finish */
    leaq  finish(%rip), %rcx
    /* save address of finish as return-address for context-function */
    /* will be entered after context-function returns */
    movq  %rcx, 0x30(%rax)

    ret /* return pointer to context-data */

trampoline:
    /* store return address on stack */
    /* fix stack alignment */
    push %rbp
    /* jump to context-function */
    jmp *%rbx

finish:
    /* exit code is zero */
    xorq  %rdi, %rdi
    /* exit application */
    call  _exit@PLT
    hlt
.size make_fcontext,.-make_fcontext

/* Mark that we don't need executable stack. */
.section .note.GNU-stack,"",%progbits

GeneralRe: Cant call an assembly function in c++ code Pin
Richard MacCutchan16-Sep-18 1:13
protectorRichard MacCutchan16-Sep-18 1:13 
AnswerRe: Cant call an assembly function in c++ code Pin
Joe Woodbury16-Sep-18 19:06
professionalJoe Woodbury16-Sep-18 19:06 
GeneralRe: Cant call an assembly function in c++ code Pin
Richard MacCutchan16-Sep-18 22:04
protectorRichard MacCutchan16-Sep-18 22:04 
GeneralRe: Cant call an assembly function in c++ code Pin
meerokh18-Sep-18 6:10
membermeerokh18-Sep-18 6:10 
Questionlaunch a word processor(MS Word) in an MS Visual C++ dialog based application Pin
zigie13-Sep-18 23:27
memberzigie13-Sep-18 23:27 
AnswerRe: launch a word processor(MS Word) in an MS Visual C++ dialog based application Pin
Victor Nijegorodov14-Sep-18 0:41
memberVictor Nijegorodov14-Sep-18 0:41 
GeneralRe: launch a word processor(MS Word) in an MS Visual C++ dialog based application Pin
zigie16-Sep-18 17:48
memberzigie16-Sep-18 17:48 
GeneralRe: launch a word processor(MS Word) in an MS Visual C++ dialog based application Pin
Victor Nijegorodov16-Sep-18 20:25
memberVictor Nijegorodov16-Sep-18 20:25 
AnswerRe: launch a word processor(MS Word) in an MS Visual C++ dialog based application Pin
_Flaviu14-Sep-18 0:42
member_Flaviu14-Sep-18 0:42 
GeneralRe: launch a word processor(MS Word) in an MS Visual C++ dialog based application Pin
zigie16-Sep-18 18:04
memberzigie16-Sep-18 18:04 
QuestionRe: launch a word processor(MS Word) in an MS Visual C++ dialog based application Pin
David Crow14-Sep-18 3:01
memberDavid Crow14-Sep-18 3:01 
AnswerRe: launch a word processor(MS Word) in an MS Visual C++ dialog based application Pin
zigie16-Sep-18 18:14
memberzigie16-Sep-18 18:14 
QuestionThe mismatch between Print preview and the real printing Pin
Member 1388734912-Sep-18 0:47
memberMember 1388734912-Sep-18 0:47 
AnswerRe: The mismatch between Print preview and the real printing Pin
Richard MacCutchan12-Sep-18 0:57
protectorRichard MacCutchan12-Sep-18 0:57 
GeneralRe: The mismatch between Print preview and the real printing Pin
Member 1388734912-Sep-18 2:03
memberMember 1388734912-Sep-18 2:03 
GeneralRe: The mismatch between Print preview and the real printing Pin
leon de boer12-Sep-18 7:05
memberleon de boer12-Sep-18 7:05 
GeneralRe: The mismatch between Print preview and the real printing Pin
Member 1388734912-Sep-18 21:07
memberMember 1388734912-Sep-18 21:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.